from selenium import webdriver
import time
import os
from selenium.webdriver.common.action_chains import ActionChains
# 下拉框选择
driver = webdriver.Chrome()
url = "file:///"+os.path.abspath("E:\\11\\测试文件\\selenium2html/drop_down.html")
driver.get(url)
driver.maximize_window()
time.sleep(3)
# # xpath 定位
# driver.find_element_by_xpath("//*[@id='ShippingMethod']/option[3]").click()

options = driver.find_elements_by_tag_name("option")
# 方法1
# for option in options:
#     if option.get_attribute('value') == '10.69':
#         option.click()
# 方法2
options[2].click()

time.sleep(6)
driver.quit()